package com.superpai.activity;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;

import com.superpai.R;

/**
 * @author Devin.Hu
 * @date 2011-8-13
 * @version V1.0
 * @description 我的拍拍页面
 */
public class MyPaipaiActivity extends BaseActivity {
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        initMenuView(this, mIndexPaiPai);
        initViews();
    }

    private void initViews(){
		title = (TextView)this.findViewById(R.id.title);
		title.setText(R.string.menu_paipai);
	}
    
	@Override
	public Object doDataConnection(int type) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void doProcessData(int type, Object... values) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onClick(View v) {
		checkMenu(v);
	}
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_BACK){
			new AlertDialog.Builder(this)
			.setTitle(R.string.common_tishi)
			.setMessage(R.string.common_sys_exit)
			.setPositiveButton(R.string.common_ok, new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int whichButton) {
					sysExit();
				}
			})
			.setNegativeButton(R.string.common_cancel, new DialogInterface.OnClickListener() {
				@Override
				public void onClick(DialogInterface dialog, int which) {
					
				}
			})
			.show();
			return true;
		}else{
			return super.onKeyDown(keyCode, event);
		}
	}
	
	@Override
	protected void onDestroy() {
		super.onDestroy();
		disConnection();
	}
}